<page-header [breadcrumb]="phNgContent" [title]="title">
  <ng-template #phNgContent class> </ng-template>
  <nz-card [nzBordered]="false">
    <form nz-form [formGroup]="form" (ngSubmit)="submit()" se-container="1" labelWidth="200">
      <se label="名称" error="名称不能为空或者空白字符" required>
        <input nz-input formControlName="name" placeholder="名称" />
      </se>
      <se label="设备类型" error="设备类型" required>
        <nz-select formControlName="deviceType" placeholder="设备类型">
          <nz-option nzValue="Device" nzLabel="设备"></nz-option>
          <nz-option nzValue="Gateway" nzLabel="网关"></nz-option>
        </nz-select>
      </se>

      <se label="超时" error="超时" required>
        <nz-input-number formControlName="timeout" [nzMin]="0"  [nzStep]="1"></nz-input-number>
      </se>
      <!-- <se label="设备型号" error="设备型号" >
        <nz-select formControlName="deviceModelId" placeholder="设备型号"  >
          <nz-option *ngFor="let o of devicemodel" [nzValue]="o.deviceModelId" [nzLabel]="o.modelName"></nz-option>
        </nz-select>
      </se> -->
      <se label="认证方式" error="认证方式" required>
        <nz-select formControlName="identityType" placeholder="设备类型">
          <nz-option nzValue="AccessToken" nzLabel="AccessToken"></nz-option>
          <nz-option nzValue="X509Certificate" nzLabel="X509Certificate"></nz-option>
        </nz-select>
      </se>
      <se>
        <input nz-input formControlName="customerId" type="hidden" />
        <input nz-input formControlName="id" type="hidden" />
        <button nz-button type="reset" (click)="close()">取消</button>
        <button nz-button nzType="primary" [disabled]="form.invalid" type="submit" [nzLoading]="submitting">保存</button>
        <button nz-button nzType="primary"  type="button" (click)="createcert($event)" *ngIf="data.id!=='00000000-0000-0000-0000-000000000000'&&data.identityType==='X509Certificate'"  >   <i nz-icon nzType="download"></i>证书生成</button>
  
    
      </se>
    </form>
  </nz-card>
</page-header>
